package xx.adapter.design;

/**
 * @Classname VoltageAdapter
 * @Description TODO 类适配器模式-适配器类
 * @Date 2023/7/25 09:06
 * @Created by wangxianlin
 */
public class VoltageAdapter extends Voltage220V implements Voltage5V{

    @Override
    public int output5V() {
        int src = output220V();
        System.out.println("原始电压：" + src + "V");
        int dst = src / 44; // 将220V电压转换成5V电压
        System.out.println("转换后电压：" + dst + "V");
        return dst;
    }
}
